using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace DataWinner.Entity.Nba_Sina.Models.Mapping
{
    public class TeamStatAvg_SinaMap : EntityTypeConfiguration<TeamStatAvg_Sina>
    {
        public TeamStatAvg_SinaMap()
        {
            // Primary Key
            this.HasKey(t => t.TeamStatAvgId);

            // Properties
            this.Property(t => t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.TeamStatAvgId)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.TeamId)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("TeamStatAvg_Sina");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.TeamStatAvgId).HasColumnName("TeamStatAvgId");
            this.Property(t => t.TeamId).HasColumnName("TeamId");
            this.Property(t => t.StatType).HasColumnName("StatType");
            this.Property(t => t.StatDate).HasColumnName("StatDate");
            this.Property(t => t.First).HasColumnName("First");
            this.Property(t => t.Second).HasColumnName("Second");
            this.Property(t => t.Third).HasColumnName("Third");
            this.Property(t => t.Fourth).HasColumnName("Fourth");
            this.Property(t => t.Ot1).HasColumnName("Ot1");
            this.Property(t => t.Ot2).HasColumnName("Ot2");
            this.Property(t => t.Ot3).HasColumnName("Ot3");
            this.Property(t => t.OtCount).HasColumnName("OtCount");
            this.Property(t => t.OtSum).HasColumnName("OtSum");
            this.Property(t => t.Shot2).HasColumnName("Shot2");
            this.Property(t => t.Goal2).HasColumnName("Goal2");
            this.Property(t => t.Shot3).HasColumnName("Shot3");
            this.Property(t => t.Goal3).HasColumnName("Goal3");
            this.Property(t => t.FreeThrow).HasColumnName("FreeThrow");
            this.Property(t => t.FreeThrowGoal).HasColumnName("FreeThrowGoal");
            this.Property(t => t.OffensiveRebound).HasColumnName("OffensiveRebound");
            this.Property(t => t.DefensiveRebound).HasColumnName("DefensiveRebound");
            this.Property(t => t.Assist).HasColumnName("Assist");
            this.Property(t => t.Foul).HasColumnName("Foul");
            this.Property(t => t.Steal).HasColumnName("Steal");
            this.Property(t => t.Turnover).HasColumnName("Turnover");
            this.Property(t => t.Block).HasColumnName("Block");
            this.Property(t => t.Scoring).HasColumnName("Scoring");
            this.Property(t => t.CreateBy).HasColumnName("CreateBy");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.ModifyBy).HasColumnName("ModifyBy");
            this.Property(t => t.ModifyTime).HasColumnName("ModifyTime");
            this.Property(t => t.IsDeleted).HasColumnName("IsDeleted");

            // Relationships
            this.HasRequired(t => t.Team_Sina)
                .WithMany(t => t.TeamStatAvg_Sina)
                .HasForeignKey(d => d.TeamId);

        }
    }
}
